package com.shanzmoo.db.personnel.entity.vo;

import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.shanzmoo.db.personnel.entity.RootGroupEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 刷机组 分页返回对象
 * @author: Gzhao 2020/12/15
 */
@Data
@ApiModel("刷机组分页返回对象")
public class RootGroupPageVo implements Serializable {

    private static final long serialVersionUID = 1758L;

    @ApiModelProperty("刷机组id")
    private Integer id;

    @ApiModelProperty("类型：0-自营，1-加盟，2-外包")
    private Integer type;

    @ApiModelProperty("组名")
    private String name;

    @ApiModelProperty("负责人")
    private String groupLeader;

    @ApiModelProperty("负责人手机号")
    private String mobile;

    @ApiModelProperty("状态：false-禁用，true-启用")
    private Boolean status;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    public static RootGroupPageVo create(RootGroupEntity rootGroupEntity) {
        return JSON.parseObject(JSON.toJSONString(rootGroupEntity), RootGroupPageVo.class);
    }
}
